﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProductGroup.aspx.cs" Inherits="SalesManagement.Modules.List.ProductGroup" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<%@ Register Src="~/Controls/List/ProductForm.ascx" TagName="WindowEditor" TagPrefix="uc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
     <ext:ResourceManager ID="ResourceManager1" runat="server" />
    <ext:Store ID="storeMain" runat="server" RemoteSort="true">
        <Proxy>
           <ext:PageProxy />
        </Proxy>
        <Reader>
            <ext:JsonReader IDProperty="obj_id">
                <Fields>
                    <ext:RecordField Name="obj_id" />
                    <ext:RecordField Name="objName" />
                    <ext:RecordField Name="objIndustry" />
                    <ext:RecordField Name="objNote" />
                </Fields>
            </ext:JsonReader>
        </Reader>       
    </ext:Store>
    <ext:Viewport ID="Viewport1" runat="server" Layout="border">
        <Items>
            <ext:GridPanel ID="grdMain" runat="server" StripeRows="true" TrackMouseOver="true"
                AutoExpandColumn="objName" Border="false" Region="Center" StoreID="storeMain">
                <TopBar>
                    <ext:Toolbar ID="tbMain" runat="server">
                        <Items>
                            <ext:ToolbarSpacer />
                            <ext:Button ID="btnAdd" runat="server" Text="Thêm mới" Icon="FolderAdd">
                                <DirectEvents>
                                    <Click OnEvent="btnAdd_Click" />
                                </DirectEvents>
                            </ext:Button>
                            <ext:Button ID="btnEdit" runat="server" Text="Hiệu chỉnh" Icon="FolderEdit">
                                <DirectEvents>
                                    <Click OnEvent="btnEdit_Click" />
                                </DirectEvents>
                            </ext:Button>
                            <ext:Button ID="btnDelete" runat="server" Text="Xóa" Icon="FolderDelete">
                                <DirectEvents>
                                    <Click OnEvent="btnDelete_Click" />
                                </DirectEvents>
                            </ext:Button>
                            <ext:Button ID="btnExport" runat="server" Text="Xuất Excel" Icon="PageExcel">
                                <DirectEvents>
                                    <Click OnEvent="btnExport_Click" />
                                </DirectEvents>
                            </ext:Button>
                             <ext:Button ID="btnPrint" runat="server" Text="In danh sách" Icon="Printer">
                                <DirectEvents>
                                    <Click OnEvent="btnPrint_Click" />
                                </DirectEvents>
                            </ext:Button>                            
                            <ext:ToolbarSpacer />
                            <ext:ToolbarFill />
                            <ext:TextField ID="txtKeyword" runat="server" EmptyText="Tìm kiếm" />
                            <ext:ToolbarSpacer />
                            <ext:Button ID="btnFind" runat="server" Text="Tìm kiếm" Icon="Find" FormBind="true">
                                <DirectEvents>
                                    <Click OnEvent="btnFind_Click" />
                                </DirectEvents>
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <ColumnModel ID="ColumnModel1" runat="server">
                    <Columns>
                        <ext:RowNumbererColumn />
                        <ext:Column ColumnID="obj_id" Header="Mã nhóm" DataIndex="obj_id" /> 
                        <ext:Column ColumnID="objName" Header="Tên nhóm" DataIndex="objName" />
                        <ext:Column ColumnID="objIndustry" Header="Tên ngành" DataIndex="objName" />
                        <ext:Column ColumnID="objNote" Header="Ghi chú" DataIndex="objCustomer" />                       
                        <ext:CommandColumn Width="75">
                            <Commands>
                                <ext:GridCommand Icon="NoteEdit" CommandName="Edit" Text="Cập nhật">
                                </ext:GridCommand>
                            </Commands>
                        </ext:CommandColumn>
                        <ext:CommandColumn Width="60" ButtonAlign="Center">
                            <Commands>
                                <ext:GridCommand Icon="NoteDelete" CommandName="Delete" Text="Xóa">
                                </ext:GridCommand>
                            </Commands>
                        </ext:CommandColumn>
                    </Columns>
                </ColumnModel>
                <DirectEvents>
                    <Command OnEvent="grdMain_OnCommand">
                        <ExtraParams>
                            <ext:Parameter Name="command" Value="command" Mode="Raw" />
                            <ext:Parameter Name="id" Value="record.data.screen_id" Mode="Raw" />
                        </ExtraParams>
                        <Confirmation ConfirmRequest="true" Message="Bạn có thật sự muốn xóa dòng dữ liệu này không?"
                            Title="Thông báo" BeforeConfirm="if (command=='Edit') return false;" />
                    </Command>
                </DirectEvents>
                <SelectionModel>
                    <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true" />
                </SelectionModel>
                <BottomBar>
                    <ext:PagingToolbar ID="paddingBar" StoreID="storeMain" runat="server" PageSize="50"
                        DisplayInfo="true" DisplayMsg="Đang xem dòng {0} đến {1} của {2}" EmptyMsg="Không có dữ liệu">
                        <Listeners>
                            <AfterRender Handler="this.refresh" />
                        </Listeners>
                    </ext:PagingToolbar>
                </BottomBar>
            </ext:GridPanel>
        </Items>
    </ext:Viewport>
     <uc:WindowEditor ID="WindowEditor" runat="server" />
    </form>
</body>
</html>
